<?php

namespace addons\booking\controller;

use addons\booking\model\Store as StoreModel;
use addons\booking\model\Worker as WorkerModel;
use addons\booking\model\StoreOrderSon;
use addons\booking\model\StoreShield;
use think\Db;
use think\Session;


class WorkerOrder extends Base
{
    protected $noNeedLogin = [];
    protected $modelValidate = true; //是否开启Validate验证，默认是false关闭状态
    protected $modelSceneValidate = true; //是否开启模型场景验证，默认是false关闭状态


    //拒绝
    public function refuse_order()
    {
        $worker_id = $this->request->param('worker_id/d',0);
        $order_id = $this->request->param('order_id/d',0);

        $res = StoreOrderSon::refuse_order($worker_id,$order_id);
        if($res['status']){
            $this->success($res['msg']);
        } else {
            $this->error($res['msg']);
        }
    }

    //接受
    public function accept_order()
    {
        $worker_id = $this->request->param('worker_id/d',0);
        $order_id = $this->request->param('order_id/d',0);

        $res = StoreOrderSon::accept_order($worker_id,$order_id);
        if($res['status']){
            $this->success($res['msg']);
        } else {
            $this->error($res['msg']);
        }
    }
}
